package com.clouds.wms.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.clouds.wms.bean.Salmb;
import com.clouds.wms.bean.Salmh;
import com.clouds.wms.bean.Salmg;
import com.clouds.wms.dao.SalmgDao;
import com.clouds.wms.dao.SalmhDao;
import com.clouds.wms.dao.SalmgDao;
import com.clouds.wms.exception.SysException;
import com.clouds.wms.util.PagesBean;

@Service("salmhService")
public class SalmhServiceImpl implements SalmhService {
	@Resource(name="salmgDao")
	private SalmgDao salmgDao;
	@Resource(name="salmhDao")
	private SalmhDao salmhDao;

	@Override
	public PagesBean getSalmhList(String mgaa, String mgab, int offset,int pageSize) throws SysException {
		return salmhDao.getSalmhList(mgaa, mgab, offset, pageSize);
	}

	@Override
	public int saveSalmh(Salmh salmh) throws SysException {
		return salmhDao.saveSalmh(salmh);
	}

	@Override
	public int getMaxMhac() throws SysException {
		return salmhDao.getMaxMhac();
	}

	@Override
	public int delSalmh(String mhaa, String mhab, String mhacs)	throws SysException {
		return salmhDao.delSalmh(mhaa, mhab, mhacs);
	}

	@Override
	public int updateSalmh(Salmh salmh) throws SysException {
		return salmhDao.updateSalmh(salmh);
	}

	@Override
	public int changeStatus(String mhaa, String mhab, String status)throws SysException {
		return salmhDao.changeStatus(mhaa, mhab, status);
	}

	@Override
	public void delSalmgmh(String mgaa, String mgab) throws SysException {
		salmgDao.delSalmgByAaAb(mgaa, mgab);
		salmhDao.delSalmhByAaAb(mgaa, mgab);
	}

	@Override
	public void delSalmhAll(String mgaa, String mgab) throws SysException {
		salmhDao.delSalmhByAaAb(mgaa, mgab);
	}
}
